// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	1/5/2014 9:51:29 PM				
// -----------------------------

#ifndef _CMath_h
#define _CMath_h

#include "Defines.h"

struct Vector4;

class Math
{
public:

	static const Float	Pi;
	static const Float	PiOver2;
	static const Float	PiTimes2;
	static const Float	PiOver4;
	static const Float	PiTimes4;
	static const Float	Epsilon;

	static Float	Lerp(Float a, Float b, Float alpha);
	static Float	Sin(Float fAngle);
	static Float	Cos(Float fAngle);
	static Float	Tan(Float fAngle);
	static Float	Sqrt(Float fValue);
	static Float	Deg2Rad(Float fDegrees);
	static Float	Rad2Deg(Float fRadians);
	static Float	Abs(Float fValue);
	static Int32	Abs(Int32 iValue);
	static Float	Pow(Float a, Float exp);
	static Float	Pow(Float a, Int32 exp);
	static Float	Min(Float a, Float b);
	static Float	Max(Float a, Float b);
	static UInt32	Min(UInt32 a, UInt32 b);
	static UInt32	Max(UInt32 a, UInt32 b);
	static Int32	Min(Int32 a, Int32 b);
	static Int32	Max(Int32 a, Int32 b);
	static Float	Clamp(Float a, Float min = 0.0f, Float max = 1.0f);
	static Float	Floor(Float a);
	static Float	Ceil(Float a);
	static Float	Mod(Float a, Float mod);
	static Float	WrapUniform(Float a);

	static UInt32	SetSeed(UInt32 uSeed);
	static UInt32	GetSeed();
	static UInt32	Random();
	static Int32	Random(Int32 uMin, Int32 uMax);
	static UInt32	Random(UInt32 uMin, UInt32 uMax);
	static Float	RandomFloat(Float fMin, Float fMax);
	static Vector4	RandomPoint(Float fMinX, Float fMaxX, Float fMinY, Float fMaxY, Float fMinZ, Float fMaxZ);
	static Vector4	RandomPoint(const Vector4& vMinPoint, const Vector4& vMaxPoint);

private:

	static UInt32	s_uSeed;

	Math();
	~Math();
	Math(const Math& refMath);
	Math& operator=(const Math& refMath);
};

#endif